package com.sun.wanandroid.ui.splash.task

import android.content.Intent
import androidx.compose.runtime.Composable
import androidx.compose.ui.platform.LocalContext
import com.google.auto.service.AutoService
import com.sun.wanandroid.MainActivity
import com.sun.wanandroid.ui.splash.ISplashComposableTask
import com.sun.wanandroid.ui.splash.SplashViewModel

/**
 *@author:sunc
 *@time :2025/7/25 13:57
 *@desc: 描述
 */
@AutoService(ISplashComposableTask::class)
class ToMainScreen(
    override val content: @Composable ((SplashViewModel) -> Unit) = { ToMainScreen(viewModel = it) },
    override val index: Int = 2
) : ISplashComposableTask


@Composable
fun ToMainScreen(viewModel: SplashViewModel) {
    LocalContext.current.apply {
        startActivity(Intent(this, MainActivity::class.java))
    }
}